using System;
using RebEngine.Managers;
using Microsoft.Xna.Framework;
using System.Windows.Forms;
using Microsoft.Xna.Framework.Graphics;
using RebellionII.GameScreens;


namespace RebellionII
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            StartGame();
        }

        private static void StartGame()
        {
            try
            {
                using (EngineManager game = new EngineManager("Rebellion II"))
                {
                    EngineManager.Game = game;
                    ScreenManager.AddScreen(new SplashScreen());
                    game.Run();
                }
            }
            catch (NoSuitableGraphicsDeviceException)
            {
                MessageBox.Show("Pixel and vertex shaders 2.0 or greater are required.",
                    "Rebellion II",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Rebellion II", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}